﻿using System.Windows.Controls;
using System.Windows.Input;

namespace LaunchPad.Core.Controls
{
    /// <summary>
    /// Interaction logic for EffectTimelineControl.xaml
    /// </summary>
    public partial class EffectTimelineControl : UserControl
    {
        public EffectTimelineControl()
        {
            InitializeComponent();
        }

        private void TimelineDataGridInitializingNewItem(object sender, InitializingNewItemEventArgs e)
        {
            var ete = e.NewItem as EffectTrackEvent;
            var effect = DataContext as EffectTrack;

            ete.Effect = effect;
            ete.Initialize(effect.Product);
        }

        public void Commit()
        {
            timelineDataGrid.CommitEdit();
        }
    }
}